/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pacoteframe;

import java.awt.Container;
import java.awt.Toolkit;
import pacoteconexao.ConexaoMySQL;
import javax.swing.*;


/**
 *
 * @author Bruno
 */

public class FrmPrincipal extends javax.swing.JFrame {
    public ConexaoMySQL cnnCliente = new ConexaoMySQL();
    /**
     * Creates new form frmPrincipal
     */
    public FrmPrincipal() {
        initComponents();
        setExtendedState(MAXIMIZED_BOTH);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jToolBar1 = new javax.swing.JToolBar();
        jButton2 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        mdiPrincipal = new javax.swing.JDesktopPane();
        bmnPrincipal = new javax.swing.JMenuBar();
        mnuCadastros = new javax.swing.JMenu();
        imnCadCargos = new javax.swing.JMenuItem();
        imnCidades = new javax.swing.JMenuItem();
        imnCadClientes = new javax.swing.JMenuItem();
        mnuSobre = new javax.swing.JMenu();

        jMenuItem1.setText("jMenuItem1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Plastek Stok - Gerenciamento de Produção e de Pessoal");
        setMinimumSize(new java.awt.Dimension(800, 600));
        setName("frmPrincipal"); // NOI18N

        jToolBar1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jToolBar1.setRollover(true);
        jToolBar1.setAlignmentY(0.0F);
        jToolBar1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jToolBar1.setDebugGraphicsOptions(javax.swing.DebugGraphics.BUFFERED_OPTION);

        jButton2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pacoteicones/Pedidos.png"))); // NOI18N
        jButton2.setText("Novo Pedido");
        jButton2.setFocusable(false);
        jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton2);

        jButton1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pacoteicones/Editar.png"))); // NOI18N
        jButton1.setText("Linha do Tempo");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton1);

        javax.swing.GroupLayout mdiPrincipalLayout = new javax.swing.GroupLayout(mdiPrincipal);
        mdiPrincipal.setLayout(mdiPrincipalLayout);
        mdiPrincipalLayout.setHorizontalGroup(
            mdiPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 950, Short.MAX_VALUE)
        );
        mdiPrincipalLayout.setVerticalGroup(
            mdiPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );

        mnuCadastros.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        mnuCadastros.setText("Cadastros");
        mnuCadastros.setContentAreaFilled(false);

        imnCadCargos.setText("Cargos");
        imnCadCargos.setContentAreaFilled(false);
        imnCadCargos.setDoubleBuffered(true);
        imnCadCargos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                imnCadCargosActionPerformed(evt);
            }
        });
        mnuCadastros.add(imnCadCargos);

        imnCidades.setText("Cidades");
        imnCidades.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                imnCidadesActionPerformed(evt);
            }
        });
        mnuCadastros.add(imnCidades);

        imnCadClientes.setText("Clientes");
        imnCadClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                imnCadClientesActionPerformed(evt);
            }
        });
        mnuCadastros.add(imnCadClientes);

        bmnPrincipal.add(mnuCadastros);

        mnuSobre.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        mnuSobre.setText("Sobre");
        bmnPrincipal.add(mnuSobre);

        setJMenuBar(bmnPrincipal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(mdiPrincipal)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(mdiPrincipal)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void imnCadCargosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imnCadCargosActionPerformed
        Container cntCargo = new FrmCadCargo().getContentPane();
        JInternalFrame frmCargo = new JInternalFrame("Cadastrar Cargos", false,true,false,true);
        frmCargo.setContentPane(cntCargo);
        mdiPrincipal.add(frmCargo);
        frmCargo.setSize(700, 350);
        frmCargo.setVisible(true);
        frmCargo.setLocation((mdiPrincipal.getWidth()/2)-700/2, (mdiPrincipal.getHeight()/2)-350/2);
        frmCargo.show();
    }//GEN-LAST:event_imnCadCargosActionPerformed

    private void imnCadClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imnCadClientesActionPerformed
        Container cntCliente = new FrmCadCliente().getContentPane();
        JInternalFrame frmCliente = new JInternalFrame("Cadastrar Clientes", false,true,false,true);
        frmCliente.setContentPane(cntCliente);
        mdiPrincipal.add(frmCliente);
        frmCliente.setSize(800, 600);
        frmCliente.setVisible(true);
        frmCliente.setLocation((mdiPrincipal.getWidth()/2)-800/2, (mdiPrincipal.getHeight()/2)-600/2);
        frmCliente.show();
    }//GEN-LAST:event_imnCadClientesActionPerformed

    private void imnCidadesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imnCidadesActionPerformed
        Container cntCidade = new FrmCadCidade().getContentPane();
        JInternalFrame frmCidade = new JInternalFrame("Cadastrar Cidades", false,true,false,true);
        frmCidade.setContentPane(cntCidade);
        mdiPrincipal.add(frmCidade);
        frmCidade.setSize(700, 350);
        frmCidade.setVisible(true);
        frmCidade.setLocation((mdiPrincipal.getWidth()/2)-700/2, (mdiPrincipal.getHeight()/2)-350/2);
        frmCidade.show();
    }//GEN-LAST:event_imnCidadesActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrmPrincipal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar bmnPrincipal;
    private javax.swing.JMenuItem imnCadCargos;
    private javax.swing.JMenuItem imnCadClientes;
    private javax.swing.JMenuItem imnCidades;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JDesktopPane mdiPrincipal;
    private javax.swing.JMenu mnuCadastros;
    private javax.swing.JMenu mnuSobre;
    // End of variables declaration//GEN-END:variables
}

